<?php

namespace Mana\Controller;

class DashController extends CommController
{
    public function index()
    {
        $manager=M("manager");
        $data=getpages($manager, null, 10);
        $this->assign("data", $data);
        $this->display();
    }
    
    public function add()
    {
        $this->parents();
        $this->display();
    }
    
    public function edit($mid)
    {
        $manager=M("manager");
        
        $data=$manager->find($mid);
        $this->assign("data", $data);
        $this->parents();
        $this->display();
    }
    
    private function parents()
    {
        $mangroup=M("mangroup");
        $parent=$mangroup->where("map_active=1")->select();
        $this->assign("group", $parent);
    }
}
